0) { $rowset = cpg_db_fetch_rowset($result); foreach ($rowset as $subcat) { if (!GALLERY_ADMIN_MODE) { $check_group = cpg_db_query("SELECT group_id FROM {$CONFIG['TABLE_CATMAP']} WHERE ($groups) AND cid = ".$subcat['cid']); $check_group_rowset = cpg_db_fetch_rowset($check_group); if ($check_group_rowset) { $CAT_LIST[] = array($subcat['cid'], $ident . $subcat['name']); } } else { $CAT_LIST[] = array($subcat['cid'], $ident . $subcat['name']); } alb_get_subcat_data($subcat['cid'], $ident . '   '); } } } list($timestamp, $form_token) = getFormToken(); // Set the message variables for the javascript file // confirm album modifications set_js_var('confirm_modifs', $lang_albmgr_php['confirm_modifs']); // confirm album delete set_js_var("confirm_delete", $lang_albmgr_php['confirm_delete1'] . "\n" . $lang_albmgr_php['confirm_delete2']); // alert when try to delete album without an album selected set_js_var('dontDelete', $lang_albmgr_php['select_first']); // confirm category change when there are unsaved changes set_js_var('category_change', $lang_albmgr_php['category_change']); // confirm page change when there are unsaved changes set_js_var('page_change', $lang_albmgr_php['page_change']); // title for upload image set_js_var('upload_file', $lang_main_menu['upload_pic_lnk']); // form token & timestamp set_js_var('form_token', $form_token); set_js_var('timestamp', $timestamp); // get the category value if ($superCage->get->keyExists('cat')) { $cat = $superCage->get->getInt('cat'); } else { $cat = 0; } if ($cat == 1) { $cat = 0; } if (!GALLERY_ADMIN_MODE && USER_ADMIN_MODE) { if ($cat == 0) { if (USER_CAN_CREATE_PRIVATE_ALBUMS) { $cat = USER_ID + FIRST_USER_CAT; } else { // user is only allowed to create public albums - get first category the user is allowed to create albums in $result = cpg_db_query("SELECT cm.cid FROM {$CONFIG['TABLE_CATMAP']} AS cm INNER JOIN {$CONFIG['TABLE_CATEGORIES']} AS c ON cm.cid = c.cid WHERE cm.group_id in (" . implode(",", $USER_DATA['groups']). ") ORDER BY pos LIMIT 1"); $cat = mysql_result($result, 0); mysql_free_result($result); } } // only list the albums owned by the user $user_id = USER_ID; } // set the cat value set_js_var('category', $cat); pageheader($lang_albmgr_php['title']); echo <<< EOT
EOT; starttable('100%', cpg_fetch_icon('alb_mgr', 2).$lang_albmgr_php['title'].' '.cpg_display_help('f=albums.htm&as=albmgr&ae=albmgr_end&top=1', '600', '400'), 1, ''); echo <<< EOT EOT; if (GALLERY_ADMIN_MODE) { $result = cpg_db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = $cat ORDER BY pos ASC"); } elseif (USER_ADMIN_MODE) { // $cat and $user_id set above $result = cpg_db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = $cat AND owner = $user_id ORDER BY pos ASC"); } else { cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__); } $rowset = cpg_db_fetch_rowset($result); $i = 100; $sort_order = ''; if (count($rowset) > 0) { foreach ($rowset as $album) { $sort_order .= $album['aid'] . '@' . ($i++) . ','; } } if (GALLERY_ADMIN_MODE || USER_ADMIN_MODE) { $CAT_LIST = array(); if (USER_CAN_CREATE_PRIVATE_ALBUMS) { $CAT_LIST[] = array(FIRST_USER_CAT + USER_ID, $lang_albmgr_php['my_gallery']); } //only add 'no category' when user is admin if (GALLERY_ADMIN_MODE) { $CAT_LIST[] = array(0, $lang_albmgr_php['no_category']); } alb_get_subcat_data(0, ''); echo <<< EOT
{$lang_albmgr_php['select_category']}  
EOT; } echo <<< EOT
EOT; if (count($rowset) > 0) { echo ' '; foreach ($rowset as $album) { $title = stripslashes($album['title']); echo <<< EOT EOT; } echo '
{$title} {$icon_array['edit']}{$lang_common['edit']}
'; } echo <<< EOT
EOT; // Only show move-buttons when admin or in user's private category. // Sorting is also prevented in delete.php when user doesn't have the rights. if (GALLERY_ADMIN_MODE || ($cat == USER_ID + FIRST_USER_CAT)) { if (defined('THEME_HAS_PROGRESS_GRAPHICS')) { $prefix = $THEME_DIR; } else { $prefix = ''; } echo <<< EOT EOT; } //we still need to show buttons to add/edit albums echo <<< EOT        
EOT; endtable(); echo '
'; pagefooter(); ?>